# Contributor: Duncan Bellamy <dunk@denkimushi.com>
maintainer="Duncan Bellamy <dunk@denkimushi.com>"
pkgname=py3-scikit-build-core
pkgver=0.10.7
pkgrel=0
pkgdesc="Build backend for Python that uses CMake to build extension modules"
url="https://github.com/scikit-build/scikit-build-core"
arch="noarch"
license="Apache-2.0"
depends="cmake py3-packaging py3-pathspec samurai"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs py3-wheel"
checkdepends="py3-build py3-cattrs py3-numpy1-dev py3-pytest py3-virtualenv"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/scikit-build/scikit-build-core/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/scikit-build-core-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest \
		--ignore tests/test_setuptools_pep517.py \
		--ignore tests/test_setuptools_pep518.py \
		--ignore tests/test_cmake_config.py \
		--ignore tests/test_settings_overrides.py \
		--ignore tests/test_pyproject_pep660.py \
		--ignore tests/test_pyproject_pep518.py \
		--ignore tests/test_program_search.py \
		--ignore tests/test_prepare_metadata.py \
		--ignore tests/test_hatchling.py \
		--ignore tests/test_get_requires.py \
		--ignore tests/test_editable.py \
		--ignore tests/test_custom_modules.py \
		--ignore tests/test_simplest_c.py \
		--ignore tests/test_setuptools_abi3.py \
		--ignore tests/test_pyproject_pep517.py \
		--ignore tests/test_pyproject_abi3.py \
		--ignore tests/test_dynamic_metadata.py \
		--ignore tests/test_broken_fallback.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
299533c671e3b9579f58c2bfd6a24ba43daf213fb662e5f11e0ce7a38993eeb7ff7b783fc50b16ba11bf7855b026cf9ab3f636cc04bc0ba51d0ef8744ec7a027  py3-scikit-build-core-0.10.7.tar.gz
"
